<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div class="box">
			<div class="local">
				你共点击按钮<span>0</span>次
			</div>
			<div class="session">
				你共点击按钮<span>0</span>次
			</div>
			<button type="button" class="btn">暴力点击</button>	
		</div>
	</body>
	<script>
	var local = document.querySelector(".local span")
	var session = document.querySelector(".session")
	var btn = document.querySelector(".btn")
	if（!localStorage.num){
		localStorage.num  = 0
	}
	local.innerHTML = localStorage.num
	
    if(!sessionStorage.num) = 0
	{sessionStorage.num=0
	}
	session.innerHTML = sessionStorage.num 
	
	btn.onclick = function(){
		sessionStorage.num++;
		localStorage.num++;
		
		local.innerHTML = localStorage.num 
		session.innerHTML =sessionStorage.num 
	}
	</script>
</html>
